const { faker } = require('@faker-js/faker')
faker.locale = 'zh_CN'
const membersModel = require('./model/membersModel')
for (let index = 0; index < 100; index++) {
  const username = faker.name.lastName() + faker.name.firstName()
  const sex = faker.name.sex() == 'male' ? '男' : '女'
  const age = faker.datatype.number({ min: 20, max: 45 })
  const phone = faker.phone.number('1##########')
  const user = {
    username,
    sex,
    age,
    phone
  }
  membersModel.insertMany([user]).then((res) => {
    console.log(res)
  })
  //   console.log(user)
}
